<template>
	<view class="container">
		
		<view class="module-container">
			<!-- <view class="module-container__bar">预订须知</view> -->
			<view class="module-container__content">
				<jyf-parser :html="contract_content"></jyf-parser>
			</view> 
		</view>
		
		<view class="yet-bottom">亲，拉到最底啦~</view>
	</view>
</template>

<script>
	// 该页面数据统一由模块页面通过setStorage进行设置获取
	import jyfParser from "@/components/jyf-parser/jyf-parser.vue";
	export default {
		components:{
			jyfParser,
		},
		data() {
			return {
				contract_content:'',
				method:''
			}
		},
		onLoad(e) {
			console.log(e)
			var _this=this
			if(e.typeid=='1'){
				_this.method = 'api/v2/line/contract'
			}else{
				_this.method = 'api/v2/outdoor/contract'
			}
			_this.contract(e.product_id)
		},
		methods: {
			async contract(id){
				var _this =this
				let params = {
					method: _this.method,
					id: id
				}
				let infoRes = await _this.$http(params);
				if(infoRes.status && infoRes.data.title){
					uni.setNavigationBarTitle({
						title: infoRes.data.title
					});
					_this.contract_content = infoRes.data.content
				}
			}
		}
	}
</script>

<style lang="scss">
	.module-container{
		margin-bottom: $uni-spacing-col-md;
		background: #fff;
		&__bar{
			padding: 20rpx 24rpx;
			border-bottom: 2rpx solid #f2f2f2;
			font-size: $uni-font-size-lg;
		}
		&__wrapper{
			padding: 20rpx 24rpx;
			&__section{
				&:first-child{
					margin-bottom: $uni-spacing-col-md;
				}
				&__bar{
					font-size: $uni-font-size-base;
				}
				&__con{
					color: #666;
					line-height: 44rpx;
					margin-top: 8rpx;
					font-size: $uni-font-size-sm;
				}
			}
		}
		&__content{
			overflow-x:auto;
			color: #666;
			padding: 20rpx 24rpx;
			line-height: 44rpx;
			font-size: $uni-font-size-sm;
		}
	}
	.yet-bottom{
		height: 56rpx;
		margin-top: -$uni-spacing-col-md;
		line-height: 56rpx;
		text-align: center;
		font-size: $uni-font-size-mini;
		color: #bebebe;
		background-color: #f7f7f7;
	}
</style>
